//
//  FeedbackInformationList.m
//  PartyClassCloud
//
//  Created by 梁素珍 on 2018/12/21.
//  Copyright © 2018年 九酷. All rights reserved.
//

#import "FeedbackInformationList.h"
@interface FeedbackInformationList ()
@property(nonatomic,strong) UITableView * tableViewList;
@property(nonatomic,strong) UIView *topView;
@property(nonatomic,strong) UIView *viewLowWhite;
@property(nonatomic,strong) NSString * strContent;

@end
@implementation FeedbackInformationList

-(void)initWithAudioPlaylist:(NSString *)content
{
    self.strContent = content;
    [self.tableViewList reloadData];
}
- (instancetype)init{
    self = [super init];
    if (self) {
        self.frame = [UIScreen mainScreen].bounds;
        //        self.backgroundColor = [UIColor whiteColor];
        /*
         阴影区域点击
         */
        self.topView = [[UIView alloc]init];
        self.topView.frame = CGRectMake(0, 0, ScreenWidth, ScreenHeight);
        self.topView.backgroundColor = [UIColor blackColor];
        self.topView.alpha = 0.5;
        [self addSubview:self.topView];
        
        UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(hiddenMBhiddenView)];
        [self.topView addGestureRecognizer:tapGesture];
        
        
        self.viewLowWhite = [[UIView alloc]init];
        self.viewLowWhite.frame = CGRectMake(0,self.topView.frame.size.height-250, ScreenWidth,250);
        self.viewLowWhite.backgroundColor = [UIColor whiteColor];
        [self.viewLowWhite.layer setMasksToBounds:YES];
        [self.viewLowWhite.layer setCornerRadius:8];
        [self addSubview:self.viewLowWhite];
  
        self.tableViewList = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, ScreenWidth,self.viewLowWhite.frame.size.height) style:UITableViewStyleGrouped];
        self.tableViewList.dataSource = self;
        self.tableViewList.delegate = self;
        self.tableViewList.separatorColor = dividerColor;
        self.tableViewList.backgroundColor = [UIColor whiteColor];
        self.tableViewList.separatorStyle = UITableViewCellSeparatorStyleNone;
        [self.viewLowWhite addSubview:self.tableViewList];
        self.tableViewList.estimatedSectionFooterHeight =0;
        self.tableViewList.estimatedSectionHeaderHeight =0;
        self.tableViewList.estimatedRowHeight = 0;
//        [self.tableViewList registerClass:[UITableViewCell class] forCellReuseIdentifier:@"UITableViewCell"];
        [self.tableViewList registerNib:[UINib nibWithNibName:@"LSZTongZhiDetailsTableViewCell" bundle:nil] forCellReuseIdentifier:@"LSZTongZhiDetailsTableViewCell"];
    }
    return self;
}
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return [LSZSpecialPackaging  getHeightOfText:ScreenWidth-20 height:ScreenHeight*2 font:15 :self.strContent]+20;
}
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
    return 0.00001;
}
-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
{
    return 0.00001;
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 1;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    LSZTongZhiDetailsTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:@"LSZTongZhiDetailsTableViewCell" forIndexPath:indexPath];
    cell.oneLabel.numberOfLines = 0;
    cell.oneLabel.text = self.strContent;
    cell.oneLabel.textColor = titleColorLSZ;
    cell.oneLabel.font = FONT_(15);
    cell.oneLabl_height.constant = [LSZSpecialPackaging  getHeightOfText:ScreenWidth-20 height:ScreenHeight*2 font:15 :self.strContent]+20;
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    return cell;
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    
}
- (void)show {
    [[UIApplication sharedApplication].keyWindow addSubview:self];
}
-(void)hiddenMBhiddenView
{
    [[NSNotificationCenter defaultCenter] removeObserver:self];
    [self removeFromSuperview];
}
 

@end
